package com.xijia.wuyouwallet.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.xijia.wuyouwallet.R;

import java.util.List;

/**
 * Created by Administrator on 2017/7/29 0029.
 */

public class ServerAdapter extends BaseAdapter {

    private List<String> list;
    private Context context;
    public ServerAdapter(List<String> list,Context context){
        this.list = list;
        this.context = context;
    }
    @Override
    public int getCount() {
        return list.size();
    }
    @Override
    public Object getItem(int i) {
        return list.get(i);
    }
    @Override
    public long getItemId(int i) {
        return i;
    }
    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHlder hoder = null;
        if (view==null){
            hoder = new ViewHlder();
            view = LayoutInflater.from(context).inflate(R.layout.item_serve,null);
            hoder.item_serve_name = (TextView) view.findViewById(R.id.item_serve_name);
            hoder.item_serve_time = (TextView) view.findViewById(R.id.item_serve_name);
            view.setTag(hoder);
        }else {
            hoder = (ViewHlder) view.getTag();
        }
        hoder.item_serve_name.setText("客服"+(i+1));
        return view;
    }
    private class ViewHlder{
        TextView item_serve_name,item_serve_time;
    }

}
